﻿using System;
using System.Diagnostics;
using Hopscotch.Domain.Common;
using Hopscotch.Domain.Common.StateTracking;
using Hopscotch.Domain.Finance;
using Newtonsoft.Json;

namespace Hopscotch.Domain.Enquiry
{
    [DebuggerDisplay("Id={Id}, InstrumentId={InstrumentId}, Qty={Qty}")]   
    public partial class TradeEnq : Trade, IEnquiryEntity<int>
    {
        public TradeEnq()
        { 
        }

        public TradeEnq(Trade trade)
            : base(trade)
        {
            this.Id = trade.Id;
            this.ChangeTracker.State = ObjectState.Unchanged;
        }

        public Trade UpcastToTrade()
        {
            Trade trade = new Trade();
            trade.Merge(this);

            trade.Id = this.Id;
            trade.ChangeTracker.State = this.ChangeTracker.State;

            return trade;
        }

        public override object Clone()
        {
            throw new NotImplementedException("Clone not implemented on Enquiry objects");
        }
        
    }
}
